﻿using System;
using System.Collections.Generic;
using System.Linq;
using MyAMS.WebServer.Models;

namespace MyAMS.WebServer.Repositories
{
    class MessageRepository : IMessageRepository
    {
        public IQueryable<Message> Get()
        {
            Message m1 = new Message
            {
                ID = Guid.NewGuid(),
                Body = "test body test body test body test body test body",
                IsRead = false,
                Sent = DateTime.UtcNow,
                Subject = "test subject"
            }; 
            Message m2 = new Message
            {
                ID = Guid.NewGuid(),
                Body = "test2 body test body test body test body test body",
                IsRead = false,
                Sent = DateTime.UtcNow,
                Subject = "test2 subject"
            };
            Message m3 = new Message
            {
                ID = Guid.NewGuid(),
                Body = "test3 body test body test body test body test body",
                IsRead = false,
                Sent = DateTime.UtcNow,
                Subject = "test3 subject"
            };
            List<Message> mockList = new List<Message>();
            mockList.Add(m1);
            mockList.Add(m2);
            mockList.Add(m3);
            return mockList.AsQueryable();
        }

        public Message Get(Guid id)
        {
            return new Message
            {
                ID = id,
                Body = "test body test body test body test body test body",
                IsRead = false,
                Sent = DateTime.UtcNow,
                Subject = "test subject"
            };
        }
    }
}
